package com.sxg.convert;

import com.sxg.entity.SxgUserEntity;
import com.sxg.vo.SxgUserVO;
import org.mapstruct.Mapper;
import org.mapstruct.Mapping;
import org.mapstruct.Mappings;
import org.mapstruct.factory.Mappers;

import java.util.List;

/**
* 用户表
*
* @author 浪漫写尽歌谱 3298751420@qq.com
* @since 1.0.0 2024-03-07
*/
@Mapper()

public interface SxgUserConvert {
    SxgUserConvert INSTANCE = Mappers.getMapper(SxgUserConvert.class);

    @Mappings(
            value = {
                    @Mapping(target = "id",ignore = true),
                    @Mapping(target = "password",ignore = true),
                    @Mapping(target = "createTime",ignore = true),
                    @Mapping(target = "updateTime",ignore = true),
            }
    )
    SxgUserEntity convert(SxgUserVO vo);

    @Mappings(
            value = {
                    @Mapping(target = "id",ignore = true),
                    @Mapping(target = "password",ignore = true),
                    @Mapping(target = "createTime",ignore = true),
                    @Mapping(target = "updateTime",ignore = true),
            }
    )
    SxgUserVO convert(SxgUserEntity entity);

    @Mappings(
            value = {
                    @Mapping(target = "id",ignore = true),
                    @Mapping(target = "password",ignore = true),
                    @Mapping(target = "createTime",ignore = true),
                    @Mapping(target = "updateTime",ignore = true),
            }
    )
    List<SxgUserVO> convertList(List<SxgUserEntity> list);

}